package practice;
import java.util.LinkedList;
import java.util.Iterator;
public class object {
         private String name;
         private String sno;
         private String gender;
         public object(String name,String sno,String gender) {
        	 this.name=name;
        	 this.sno=sno;
        	 this.gender=gender;
         }
         LinkedList<String> list=new LinkedList<String>();
         Iterator <String> it=list.iterator();
         public void Add() {
        	 list.add(name);
        	 list.add(sno);
        	 list.add(gender);
         }
         public void Pop(String string) {
        	 String c;
        	 while(it.hasNext()) {
        		 c=it.next();
        		 if(c.equals(string)) {
        			 it.remove();
        		 }
        	 }
        	 
         }
         public String FindInformation(String string) {
        		if(list.contains(string)) 
            		return " "+name+" "+sno+" "+gender+"\n";
            	else
            		return "..............";	 	
         }
         public void Revise(String string,String string1) {
        	 String c;
        	 while(it.hasNext()) {
        		 c=it.next();
        		 if(c.equals(string)) {
        			list.set(list.indexOf(string),string1);
        		 }
        	 }
         }
         public void print() {
        	 System.out.println(list);
         }
}

